﻿using System;
using System.Collections.Generic;
using RouteMaster;

namespace RouteMasterTest
{
    public class World : iWorld
    {
        Dictionary<string, BusStop> _theStops = new Dictionary<string, BusStop>();
        Dictionary<int, BusStop> _theStopsById = new Dictionary<int, BusStop>();

        public int BusStopFactory(string name, int index)
        {
            var bs = new BusStop(index, name);
            _theStops.Add(name, bs);
            _theStopsById.Add(index, bs);
            return index;
        }

        public Dictionary<string, BusStop> TheStops
        {
            get { return _theStops; }
        }

        public BusStop GetByName(string name)
        {
            return _theStops[name];
        }

        public BusStop GetById(int id)
        {
            return _theStopsById[id];
        }
    }
}
